Skip to content

Stabilize tox by fixing Ruff/Pyright drift and restoring full coverage#308

Merged
wolph merged 3 commits intodevelopfrom
copilot/fix-tox-build-issues
Apr 18, 2026
Merged

Stabilize tox by fixing Ruff/Pyright drift and restoring full coverage#308
wolph merged 3 commits intodevelopfrom
copilot/fix-tox-build-issues

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 18, 2026

The current tox run was failing for three separate reasons: new Ruff rules flagged existing code, Pyright emitted a config warning for an unsupported setting, and the test suite fell just short of the repository’s 100% coverage gate. This change brings those checks back into agreement without changing the public behavior of the package.

  • Lint/config alignment

    • Remove the unsupported reportUnnecessaryTypeAssertion Pyright setting.
    • Fix the Ruff findings in progressbar/bar.py by removing an unnecessary int(...) cast and marking the unused resize tuple element explicitly.
  • Coverage gap

    • Add a focused stream test that exercises the enable_colors=True update path, covering the remaining uncovered branch in the bar output code.
  • Formatter stability

    • Adjust formatting-sensitive code so repeated black and ruff format runs converge instead of rewriting the same files back and forth.
# Covered explicitly now: colored output should be preserved when enabled.
with progressbar.ProgressBar(
    fd=stream,
    widgets=['\033[92mgreen\033[0m'],
    max_value=1,
    enable_colors=True,
) as bar:
    bar.update(1)

Copilot AI and others added 3 commits April 18, 2026 01:57
@wolph wolph marked this pull request as ready for review April 18, 2026 02:27
Copilot AI review requested due to automatic review settings April 18, 2026 02:27
@wolph
Copy link
Copy Markdown
Owner

wolph commented Apr 18, 2026

/gemini review

@codex

@chatgpt-codex-connector
Copy link
Copy Markdown

To use Codex here, create an environment for this repo.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR stabilizes the project’s tox/CI checks by aligning linting/type-checking configuration, resolving newly enforced Ruff findings, and closing the remaining coverage gap without changing package behavior.

Changes:

  • Removed an unsupported Pyright setting from pyproject.toml to eliminate config warnings.
  • Addressed Ruff/format drift in progressbar/bar.py, progressbar/env.py, and progressbar/__main__.py to keep formatting stable across tools.
  • Added a targeted stream test to cover the enable_colors=True update/output path and restore 100% coverage.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/test_stream.py Adds a focused regression test ensuring ANSI color sequences are preserved when enable_colors=True.
pyproject.toml Removes an unsupported Pyright option to stop config warnings/failures.
progressbar/env.py Tweaks f-string formatting for regex construction to prevent formatter churn.
progressbar/bar.py Fixes Ruff findings (unnecessary cast, unused tuple element) and consolidates a warning string for stable formatting.
progressbar/__main__.py Refactors parser description assignment to avoid repeated formatter rewrites.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the argument parser description in __main__.py, simplifies calculation logic and handles an unused variable in bar.py, and updates string formatting in env.py. It also removes an unnecessary type assertion setting in pyproject.toml and adds a new test case for color support in tests/test_stream.py. I have no feedback to provide.

@wolph wolph merged commit 24cfd2e into develop Apr 18, 2026
15 checks passed
@wolph wolph deleted the copilot/fix-tox-build-issues branch April 18, 2026 02:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants